package com.badibadi.adapter;

import java.util.ArrayList;
import java.util.List;

import com.badibadi.infos.AreaModel;
import com.badibadi.mytools.Constants;
import com.badibadi.uniclubber.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class AreaAdapter extends BaseAdapter {

	private Context context;
	private List<AreaModel> list = new ArrayList<AreaModel>();

	public AreaAdapter(Context context, List<AreaModel> list) {
		this.context = context;
		this.list = list;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = LayoutInflater.from(context);
		convertView = inflater.inflate(R.layout.area_layout_main, null);
		TextView area_name = (TextView) convertView
				.findViewById(R.id.area_name);
		area_name.setText(list.get(position).getArea_name());
		return convertView;
	}

}
